import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:pplive/common/api_service.dart';
import 'package:pplive/routes/AppRoute.dart';

import 'common/utils.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    ApiService.register();
    final screenSize = MediaQuery.of(context).size;
    Util.shared().screenHeight = screenSize.height;
    Util.shared().screenWidth = screenSize.width;

    return GetMaterialApp(
        title: 'PPLive',
        debugShowCheckedModeBanner: false,
        theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(
            seedColor: Colors.deepPurple,
              onSurface:  Color(0xff1F1B26),
          ),
          useMaterial3: true,
        ).copyWith(
            textTheme: TextTheme(
                titleMedium: TextStyle(
                    fontFamily: "PingFang SC",
                    fontSize: 16,
                    fontWeight: FontWeight.w500,
                    color: Color(0xFFFFFDFF)),
                bodySmall: TextStyle(
                    fontFamily: "PingFang SC",
                    fontSize: 11,
                    fontWeight: FontWeight.w500,
                    color: Color(0xffffffff)),
                labelSmall: TextStyle(
                    fontFamily: "PingFang SC",
                    fontSize: 12,
                    fontWeight: FontWeight.w400,
                    color: Color(0x66ffffff)),
                labelMedium: TextStyle(
                    fontFamily: "PingFang SC",
                    fontSize: 14,
                    fontWeight: FontWeight.w400,
                    color: Colors.white),
                labelLarge: TextStyle(
                    fontFamily: "PingFang SC",
                    fontSize: 14,
                    fontWeight: FontWeight.w600,
                    color: Colors.white))),
        initialRoute: AppPage.main.rawValue,
        defaultTransition: Transition.rightToLeft,
        getPages: AppRoute.pages,
        builder: EasyLoading.init());
  }
}
